define(['app'], function(app) {
	'use strict';

	//实例化方法
	var factory = function(Http) {
		function get_data_contactShow(result) {
			if(false) {
				result = '{"success":true,"msg":"","result":{"cusphone":[{"id":"001","type":"1","value":"1234567"},{"id":"002","type":"2","value":"123456789111"}]},"session":"7311da98bd0f18eb15a96bcb263f4153"}';
				return JSON.parse(result);
			} else {
				return result;
			}
		}
		
		//返回信息
		return {
			//客服QQ与联系方式
			contact_show: function(callback) {
				Http.post({
					method: 'member.cusphone.show',
				}, function(result) {
					//函数回调
					if(callback)
						callback(get_data_contactShow(result).result);
				}, function(e) {

				}, function() {

				});
			},
			contact_delete:function(id,callback){
				Http.post({
					method:'member.cusphone.delete',
					id:id
				},function(result){
					if(callback)
					callback(result);
				},function(){
					
				})
			},
			contact_setdefault:function(id,callback){
				Http.post({
					method:'member.cusphone.setdefault',
					id:id
				},function(result){
					if(callback)
					callback(result);
				},function(e){
					
				})
			}
			
			
		};
	}

	factory.$inject = ['Http'];
	return app.registerService("Customqq", factory);
});